#include "reg52.h"
#include "intrins.h"

sbit led_one = P3^7;
sbit led_two = P3^6;
sbit key1 = P2^1;
sbit key2 = P2^0;

void Delay500ms()		//@11.0592MHz
{
	unsigned char i, j, k;

	_nop_();
	i = 4;
	j = 129;
	k = 119;
	do
	{
		do
		{
			while (--k);
		} while (--j);
	} while (--i);
}

void Delay50ms()		//@11.0592MHz
{
	unsigned char i, j;

	i = 90;
	j = 163;
	do
	{
		while (--j);
	} while (--i);
}



int main()
{
	
	while(1){
		if(key1 == 0){
			Delay50ms();
			if(key1 == 0){
				led_one = 0;
				led_two = 0;
			}
		}
		if(key2 == 0){
			Delay50ms();
			if(key2 == 0){
				led_one = 1;
				led_two = 1;
			}
	}
		

	}


	return 0;
}